cmake_minimum_required(VERSION 3.17)
project(sample_c)

set(CMAKE_CXX_STANDARD 14)
#set(LINK_DIR E:\\c_lib\\mysql-connector-c-6.1.11-win32-debug\\mysql-connector-c-6.1.11-win32\\lib)
#set(LINK_DIR E:\\c_lib\\mysql-connector-c-6.1.11-win32-debug\\mysql-connector-c-6.1.11-win32\\lib\\debug)

#**************************************
include_directories("E:\\c_lib\\mysql-connector-c-6.1.11-winx64\\mysql-connector-c-6.1.11-winx64\\include")  #添加include的路径
link_directories("E:\\c_lib\\mysql-connector-c-6.1.11-winx64\\mysql-connector-c-6.1.11-winx64\\lib")     #添加lib路径
# 会报错
#link_libraries(E:\\c_lib\\mysql-connector-c-6.1.11-winx64\\mysql-connector-c-6.1.11-winx64\\lib\\libmysql.dll)
link_libraries(libmysql)
#**************************************

add_executable(sample_c forkD.c main.c dbtest.c student.c main2.c)

#target_link_libraries(sample_c libmysql)    #链接对应的库到本工程
target_link_libraries(sample_c libmysql.dll)    #链接对应的库到本工程